using CMS.Application.common.Interface;
using SoftDemo.Api.Controllers;

namespace CMS.Api.Controllers
{
    /// <summary>
    /// 获取图片静态类
    /// </summary>
    public class GetImg
    {

        /// <summary>
        /// 获取图片的函数
        /// </summary>
        /// <param name="id"></param>
        /// <param name="_fileUploadService"></param>
        /// <returns></returns>
        public async Task<object> GetImgFn(Guid id, IFileUploadService _fileUploadService)
        {

            
            // 实例化接口
            var UploadController = new UploadController(_fileUploadService);


            // 根据传入的id查找文件，并编码返回
            var result = await UploadController.GetFile(id);



            return new {

                result.FileContents,

                result.ContentType

            };

        }


    }
}